import {createRouter, createWebHistory, RouteRecordRaw} from "vue-router";

const routes: Array<RouteRecordRaw> = [
    {
        path: "/",
        name: "body",
        component: () => import((`../views/body/Body.vue`)),
        children: [
            {
                path: "/",
                name: "index",
                component: () => import((`../views/body/index/Body.vue`)),
                meta: {
                    title: "首页",
                },
            },
            {
                path: "/manage",
                name: "manage",
                component: () => import((`../views/body/manage/Body.vue`)),
                meta: {
                    title: "管理",
                },
                children: [
                    {
                        path: "/manage/system",
                        name: "system",
                        meta: {
                            title: "系统管理",
                        },
                        children: [
                            {
                                path: "/manage/system/user",
                                name: "user",
                                component: () => import((`../views/body/manage/system/user/Body.vue`)),
                                meta: {
                                    title: "用户管理",
                                }
                            },
                            {
                                path: "/manage/system/org",
                                name: "org",
                                component: () => import((`../views/body/manage/system/org/Body.vue`)),
                                meta: {
                                    title: "组织管理",
                                }
                            }
                        ]
                    }
                ]
            }
        ]
    },
    {
        path: "/login",
        name: "login",
        component: () => import((`../views/login/Body.vue`)),
        meta: {
            title: "登录",
        },
    }
];

const router = createRouter({
    history: createWebHistory(),
    routes,
});

export default router;
